import { baseRequest } from "@/utils/request";
const request = (url, ...arg) => baseRequest(`/order/${url}`, ...arg);

export default {
  // 获取人员分页
  queryPage(data) {
    return request("queryPage", data);
  },
  queryDetail(data) {
    return request("queryDetail", data);
  },
  // 提交表单 edit为true时为编辑，默认为新增
  save(data, edit = false) {
    return request(edit ? "save" : "save", data);
  },
  sureOrder(data) {
    return request("sureOrder", data);
  },
  cancel(data) {
    return request("cancel", data);
  },
  queryProductMakeGoods(data) {
    return request("queryProductMakeGoods", data);
  },
  makeGoodSuccess(data) {
    return request("makeGood", data);
  },
  analysis(data) {
    return request("analysis", data);
  },
  salesStatisticsByDay(data) {
    return request("salesStatisticsByDay", data);
  },
  salesStatisticsByDateRange(data) {
    return request("salesStatisticsByDateRange", data);
  },
  // 人员导出
  orderExport(data) {
    return request("exportList", data, "get", {
      responseType: "blob",
    });
  },
  allocation(data) {
    return request("allocation", data);
  },
  summaryForChart(data) {
    return request("summaryForChart", data);
  },
};
